// 统一请求路径前缀在libs/axios.js中修改
import {
  getRequest,
  postRequest,
  putRequest,
  deleteRequest
} from "@/libs/axios";

// 获取活动分页列表
export const getPromotionListData = params => {
  return getRequest(`/promotion/page`, params);
}
// 添加活动
export const postPromotion = params => {
  return postRequest(`/promotion`,params);
}
// 更新活动 
export const putPromotion = params => {
  return putRequest(`/promotion`,params);
}
// 删除活动
export const deletePromotion = id => {
  return deleteRequest(`/promotion/${id}`);
}
// 批量删除活动
export const deleteBatchPromotion = params => {
  return deleteRequest(`/promotion/`,params);
}
// 初始化活动商品分页列表
export const getPromotionGoodsListData = (id,params) => {
  return getRequest(`/cutpricegoods/${id}`, params);
}

// 获取活动商品分页列表
export const getPromotionGoodspageData = (ids,params) => {
  return getRequest(`/cutpricegoods/page/${ids}`, params);
}
// 添加活动
export const postPromotionGoods = params => {
  return postRequest(`/cutpricegoods`,params);
}
// 更新活动 
export const putPromotionGoods = params => {
  return putRequest(`/cutpricegoods`,params);
}
// 删除活动商品
export const deletePromotionGoods = id => {
  return deleteRequest(`/cutpricegoods/${id}`);
}
// 批量删除活动商品
export const deleteBatchPromotionGoods = params => {
  return deleteRequest(`/cutpricegoods/`,params);
}